<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>隔行换色</title>
    <script src="js/jquery/jquery-3.3.1.min.js"></script>
    <style>
        table{
            width: 800px;
            margin: auto;
            text-align: center;
            border: 1px solid lightgray;
            padding: 0px;
            box-sizing: border-box;
            margin-top: 50px;
        }
        th,td{
            border: 1px solid lightgray;
            height: 30px;
        }
    </style>
    <script>
        $(function (){
             $("tr:odd").css("backgroundColor","lightblue");
             $("tr:even").css("backgroundColor","lightpink");

        });
    </script>
</head>
<body>
<table cellspacing="0">
    <caption>西瓜便利店3月份库存统计</caption>
  <tr>
    <th>序号</th><th>物品名称</th><th>物品单位</th><th>入库总计</th><th>出库总计</th><th>剩余库存</th>
  </tr>
  <tr>
    <td>1</td><td>花生油</td><td>瓶</td><td>280</td><td>41</td><td>239</td>
  </tr>
    <tr>
        <td>2</td><td>苹果</td><td>箱</td><td>22</td><td>1</td><td>21</td>
    </tr>
    <tr>
        <td>3</td><td>奥利奥</td><td>包</td><td>12</td><td>10</td><td>2</td>
    </tr>
    <tr>
        <td>4</td><td>啤酒</td><td>箱</td><td>10</td><td>4</td><td>6</td>
    </tr>
    <tr>
        <td>5</td><td>方便面</td><td>桶</td><td>100</td><td>23</td><td>77</td>
    </tr>
    <tr>
        <td>6</td><td>火腿肠</td><td>袋</td><td>10</td><td>1</td><td>9</td>
    </tr>
    <tr>
        <td>7</td><td>纯净水</td><td>瓶</td><td>50</td><td>41</td><td>9</td>
    </tr>
    <tr>
        <td>8</td><td>大米</td><td>袋</td><td>12</td><td>5</td><td>7</td>
    </tr>
    <tr>
        <td>9</td><td>五花肉</td><td>斤</td><td>50</td><td>46</td><td>4</td>
    </tr>
    <tr>
        <td>10</td><td>白菜</td><td>斤</td><td>300</td><td>260</td><td>40</td>
    </tr>

</table>
</body>
</html>